package com.e3.basdoc.measure.client;

import com.e3.basdoc.measure.model.MeasureUnitModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;

public class MeasureUnitEditorDialog extends TGFEditorDialog<MeasureUnitModel> {
	
	private MeasureUnitRPCServiceAsync service = MeasureUnitRPCService.Util.getInstance();

	@Override
	public TGFSimpleFormPanel<MeasureUnitModel> createFormPanel() {
		return new MeasureUnitFormPanel();
	}

	@Override
	public void executeNewService(final MeasureUnitModel model, GwtAsyncCallback<MeasureUnitModel> callback) {
		service.newMeasureUnit(model,callback);
	}

	@Override
	public void executeModifyService(final MeasureUnitModel model, GwtAsyncCallback<MeasureUnitModel> callback) {
		service.newMeasureUnit(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return MeasureUnitHelper.INSTANCE.getNotNullFieldNames();
	}

}
